package com.ruoyi.controller;

import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.publisher.RabbitMQProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hlf
 * @createTime 2025/2/6 16:53
 * @description
 */
@RestController
@RequestMapping("/testMq/abc")
public class SpringAmqpController extends BaseController {

    @Autowired
    private RabbitMQProducer rabbitMQProducer;


    @GetMapping("/testSimple")
    @Anonymous
    public void testSimple() {
        rabbitMQProducer.sendMessage("Hello, RabbitMQ aaaaaa!");
    }
}
